package com.mew.slots.core.game.mnyys.message;

import com.mew.slots.core.common.messge.response.SlotsBonusPlayResponseMessage;
import com.mew.slots.core.game.mnyys.dto.Mg;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

/**
 * @author dylin
 * @create 2021/3/12
 */
@Data
@ToString(callSuper = true)
public class MnyysBonusPlayResponseMessage extends SlotsBonusPlayResponseMessage {
    private int up;//向上 0 否 1 是
    private long gold;//获得金币
    private long allGold;//全部金币
    private List<Mg> mgs=new ArrayList<>();//玫瑰集合
    private int isGameOver;//游戏是否结束 0否 1是
    private List<Mg> allMgs=new ArrayList<>();//全部集合

    @Override
    public void write(ByteBuf b) {
        super.write(b);
        writeInt(b,up);
        writeLong(b,gold);
        writeLong(b,allGold);
        writeInt(b,mgs.size());
        for(Mg ls:mgs){
            ls.write(b);
        }
        writeInt(b,isGameOver);
        writeInt(b,allMgs.size());
        for(Mg als:allMgs){
            als.write(b);
        }
    }

    @Override
    public MnyysBonusPlayResponseMessage read(ByteBuf byteBuf) {
        return null;
    }
}
